import createAxios from '/@/utils/axios'
import { useAdminInfo } from '/@/stores/adminInfo'

export const url = '/admin/'

export function index() {
    return createAxios({
        url: url + 'index',
        method: 'get',
    })
}

export function login(method: 'get' | 'post', params: object = {}) {
    return createAxios({
        url: url + 'login',
        data: params,
        method: method,
    })
}

export function logout(method: 'get' | 'post', params: object = {}) {
    return createAxios({
        url: url + 'admin/loginOut',
        data: params,
        method: method,
    })
}

export function sendSms(method: 'post', params: object = {}) {
    return createAxios({
        url: url + 'admin/sendSms',
        data: params,
        method: method,
    })
}

export function telLogin(method: 'post', params: object = {}) {
    return createAxios({
        url: url + 'admin/telLogin',
        data: params,
        method: method,
    })
}
